package com.neu.admin;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.neu.common.RequiresPermissionsDesc;
import com.neu.common.validator.Order;
import com.neu.common.validator.Sort;
import com.neu.doc.AdminHistoryController_list;
import com.neu.domain.ShoppingBrand;
import com.neu.domain.ShoppingSearchHistory;
import com.neu.service.ShoppingSearchHistoryService;
import com.neu.util.ResponseUtil;

import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

import java.util.List;

@RestController
@RequestMapping("/admin/history")
@Validated
public class AdminHistoryController {
    private final Log logger = LogFactory.getLog(AdminHistoryController.class);
@Autowired
private ShoppingSearchHistoryService shoppingSearchHistoryService;
  
    @RequiresPermissions("admin:history:list")
    @RequiresPermissionsDesc(menu = {"用户管理", "搜索历史"}, button = "查询")
    @GetMapping("/list")
    public Object list(String from,String keyword,
            @RequestParam(defaultValue = "1") Integer page,
            @RequestParam(defaultValue = "10") Integer limit,
            @Sort @RequestParam(defaultValue = "add_time") String sort,
            @Order @RequestParam(defaultValue = "desc") String order) {
    		List<ShoppingSearchHistory> BrandList = shoppingSearchHistoryService.querySelective(from,keyword, page, limit, sort, order);
    		return ResponseUtil.okList(BrandList);

    }
}
